<%@page import="cn.edu.pku.wxlib.userborrowtype.model.*" %>

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>Userborrowtype维护</title>
	
	<script src="${ctx}/scripts/rest.js" ></script>
	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
	
	<script type="text/javascript" >
		$(document).ready(function() {
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
	<form id="queryForm" name="queryForm" method="get" style="display: inline;">
	<div class="queryPanel">
		<fieldset>
			<table>
				<div class="form-group inline">
					<label>老师，应届生，毕业生</label>	
					<input placeholder="请输入老师，应届生，毕业生" value="${query.userBorrowTypeName}" id="userBorrowTypeName" name="userBorrowTypeName" maxlength="6"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>借阅天数</label>	
					<input placeholder="请输入借阅天数" value="${query.duration}" id="duration" name="duration" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>1启用,0禁用</label>	
					<input placeholder="请输入1启用,0禁用" value="${query.state}" id="state" name="state" maxlength="10"  class="form-field"/>
					<br/>
				</div>
			</table>
			<button type="button" class="btn btn-default" onclick="getReferenceForm(this).action='${ctx}/userborrowtype'">查询</button>
		</fieldset>
		<div class="handleControl">
			<button type="button" class="btn btn-default" onclick="window.location = '${ctx}/userborrowtype/new'">新增</button>
			<button type="button" class="btn btn-default" onclick="doRestBatchDelete('${ctx}/userborrowtype','items',document.forms.queryForm)">删除</button>
		<div>
	
	</div>
	
	<div class="gridTable">	
		<table width="100%"  border="0" cellspacing="0" class="table text-center">
		  <thead>			  
			  <tr>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>
				<th sortColumn="userBorrowTypeName" >老师，应届生，毕业生</th>
				<th sortColumn="duration" >借阅天数</th>
				<th sortColumn="state" >1启用,0禁用</th>
				<th style="white-space:nowrap;">操作</th>
			  </tr>			  
		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">
			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td><input type="checkbox" name="items" value="${item.userBorrowTypeId}"></td>
				<td><c:out value='${item.userBorrowTypeName}'/>&nbsp;</td>
				<td><c:out value='${item.duration}'/>&nbsp;</td>
				<td><c:out value='${item.state}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/userborrowtype/${item.userBorrowTypeId}">查看</a>&nbsp;&nbsp;
					<a href="${ctx}/userborrowtype/${item.userBorrowTypeId}/edit">修改</a>&nbsp;&nbsp;
					<a href="${ctx}/userborrowtype/${item.userBorrowTypeId}" onclick="doRestDelete(this,'你确认删除?');return false;">删除</a>
				</td>
			  </tr>
			  
		  	  </c:forEach>
		  </tbody>
		</table>
	
		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
		
	</div>
	</form>
</rapid:override>
<rapid:override name="script">
	<script></script>
</rapid:override>
<%@ include file="base.jsp" %>
